A conventional spreadsheet program such as Microsoft Excel handles calculation and recalculation of formulas within a spreadsheet utilizing a single calc chain, which is essentially an ordered list of all formulas entered into all worksheets currently loaded by Excel. Further, there is a single copy of each variable pertaining to this calc chain. When a formula is entered into a worksheet, the formula is added to the beginning of the global calc chain. When a recalculation (recalc) operation is triggered, either by modifying the contents of cells upon which formulas depend, or by manually requesting a recalc operation, Excel will iterate through the calc chain and recalc any formulas which have been marked as “dirty” (i.e., pending recalc). Thus a single control thread iterates through the single chain of formulas. The calc chain is saved to file with information to preserve its ordering. Then, upon re-loading the spreadsheet and calc chain, the formulas are in their proper order, according to their dependencies, for processing the formulas. This prevents Excel from having to duplicate the work to order the calc chain.
The following scenario illustrates how a conventional spreadsheet program chain calculation routine handles dependencies between formulas. Consider the worksheet 10 shown in FIG. 15. The calc chain 12 for spreadsheet 10 may be represented as in FIG. 16. In this conventional spreadsheet chain 12, the code always evaluates the first cell on the left first. In the case above, the code begins by evaluating the first cell, C4. When trying to evaluate the formula “=A4+B4”, the calc code discovers that the formula depends on cell A4, and that cell A4 is “dirty”, i.e., is yet to be calculated. In this situation, the formula “=A4+B4” is called the “dependent” formula, and the formula in cell A4 is called a “supporting” formula. The code stops evaluating the formula =A4+B4, pulls the formula for cell A4 out of the calc chain, and re-inserts it immediately before the formula for cell C4. Then, the calc code resumes its work starting at the formula for cell A4. The calc code evaluates A4 with no problem and moves on to C4. When trying to evaluate the formula =A4+B4 (for the second time), the calc code sees that A4 is now calculated (no longer “dirty”), but discovers that the formula also depends on cell B4, and that B4 is also dirty. So, again, the code stops evaluating the formula and moves the formula for B4 immediately before the formula for C4. The code then evaluates B4 with no problem, and moves on to C4 (now for the third time). C4 can now be evaluated, completing the process. The reordered chain 14 is shown in FIG. 17.
This reordered chain 14 is then saved for subsequent recalc operations so that the spreadsheet program does not have to redo this analysis and reordering each time a recalculation is either manually or automatically requested by some change made in the spreadsheet. With extremely complex spreadsheet demands, especially in large financial projection scenarios, there is a substantial amount of processing time required for performing the long chain calculations in the manner described above. Users do not like to wait long for results when changing scenarios in their projections. Thus there is an incentive to reduce this processing time. It is with respect to these and other considerations that the present invention has been made.